home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / ABox 1.9.5 / CPlus Files / ABUEnvSpeechSynth.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-26  |  3.3 KB  |  122 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
  8.     See the Modification History for more details.
  9.  
  10. Product
  11.     About Box
  12.  
  13. FILE
  14.     ABUEnvSpeechSynth.c
  15.  
  16. NAME
  17.     ABUEnvSpeechSynth.c, part of the ABox project source code,
  18.     responsible for mix-in handling the AboutBox speech synthesis
  19.     environment stuff.
  20.  
  21. DESCRIPTION
  22.     This file contains defines for the about box modules.
  23.     
  24. DEVELOPED BY
  25.     George (ty) Tempel                ttempel@monmouth.com
  26.     All code in this file, and its associated header file was
  27.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  28.     "FilterTop" application development, except where noted.
  29.  
  30. CARETAKER - George (ty) Tempel <ttempel@monmouth.com>
  31.      Please consult this person for any changes or suggestions to this file.
  32.  
  33. MODIFICATION HISTORY
  34.  
  35.     dd mmm yy    -    xxx    -    patchxx: description of patch
  36.     10 June 94    -    ty    -    Initial Version Created
  37.     20-july-94    -    ty    -    initial version released
  38.     15-mar-95    -    ty    -    added some fixes since the speech mgr detection
  39.                             didn't seem to work on the PowerMac 8100/80 at work,
  40.                             yet works fine on all 680x0 macs. Go figger...
  41.     27-apr-95    -    ty    -    improved Gestalt checking
  42.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  43.                             release and the associated Universal Headers from Apple:
  44.                             most methods that returned references now have "Ref" at
  45.                             the end of their methods names to prevent possible collisions
  46.                             with datatypes and classes of the same name (older versions
  47.                             of the compiler didn't have a problem with this).
  48.     25-oct-95    -    ty    -    changes for "const" usage under CW7; simplification of Boolean
  49.                             query methods
  50.  
  51. */
  52.  
  53. /*===========================================================================*/
  54.  
  55. /*======= Segmentation directives ========*/
  56.  
  57. #ifdef USE_MANUAL_SEGMENTATION
  58. #pragma segment ty
  59. #endif
  60.  
  61. /*============ Header files ==============*/
  62.     
  63. #include     "ABUEnvSpeechSynth.h"
  64.  
  65. /*=============== Globals ================*/
  66.  
  67. /*================ CODE ==================*/
  68.  
  69.  
  70. /*=============================== ABUEnvSpeechSynth::ABUEnvSpeechSynth ================================*/
  71. ABUEnvSpeechSynth::ABUEnvSpeechSynth(void)
  72. {
  73. }    // end ABUEnvSpeechSynth
  74.  
  75.  
  76. /*=============================== ABUEnvSpeechSynth::~ABUEnvSpeechSynth ================================*/
  77. ABUEnvSpeechSynth::~ABUEnvSpeechSynth(void)
  78. {
  79. }    // end ~ABUEnvSpeechSynth
  80.  
  81.  
  82.  
  83. /*=============================== ABUEnvSpeechSynth::IsPresent ================================*/
  84. Boolean    ABUEnvSpeechSynth::IsPresent(void)
  85. {
  86.     OSErr    error = noErr;
  87.     
  88.     //    begin here...
  89.     
  90.     error = this->CheckGestalt(gestaltSpeechAttr);
  91. #if GENERATINGCFM
  92.     if ( (error == noErr) &&
  93.         (this->Attribute(gestaltSpeechMgrLibPresent) ||
  94.         this->Attribute(gestaltSpeechMgrPresent)) )
  95. #else
  96.     if ( (error == noErr) &&
  97.         (this->Attribute(gestaltSpeechMgrPresent)))
  98. #endif
  99.         this->IndicatorRef() = true;
  100.     else
  101.         this->IndicatorRef() = false;
  102.         
  103.     return this->IndicatorRef();
  104. }    // end IsPresent
  105.  
  106.  
  107.  
  108. /*=============================== ABUEnvSpeechSynth::End ================================*/
  109. OSErr    ABUEnvSpeechSynth::End(void)
  110. {
  111.     OSErr    error = noErr;
  112.     
  113.     //    begin here...
  114.     if (!this->IsPresent())
  115.         return error;
  116.     
  117.     error = ::SpeakString((StringPtr)NULL);
  118.  
  119.     return error;
  120. } // end End
  121.  
  122.